package com.yunhe.device.domain.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Property;

/**
 * @ClassName EquipmentAttributes
 * @Description 设备属性模型
 * @Author HeTao
 * @Date 2021/7/13 17:18
 * @Version 1.0
 **/
@ApiModel(value = "EquipmentAttributes", description = "设备属性模型")
@NodeEntity
@Data
public class EquipmentAttributes implements Comparable<EquipmentAttributes> {

    @Id
    @GeneratedValue
    @ApiModelProperty(value = "id")
    private Long id;

    @Property
    @ApiModelProperty(value = "设备属性编码")
    private String name;

    @Property
    @ApiModelProperty(value = "设备属性名称")
    private String title;

    @Property
    @ApiModelProperty(value = "设备属性组件类型")
    private String componentType;

    @Property
    @ApiModelProperty(value = "排序")
    private Long  sn;

    @Property
    @ApiModelProperty(value = "创建时间")
    private String createTime;

    @Property
    @ApiModelProperty(value = "更新时间")
    private String updateTime;

    @ApiModelProperty("接口路径")
    @Property
    private String url;

    @ApiModelProperty("是否必填")
    @Property
    private boolean required;

    @Property
    private String activity="1";


    @Property
    private boolean initData=false;

    @Property
    private String type="01";

    @Override
    public int compareTo(EquipmentAttributes o) {
        if (o == null) {
            return 1;
        }
        if (this.sn == null) {
            return -1;
        } else if (o.getSn() == null) {
            return 1;
        }
        return this.sn.compareTo(o.getSn());
    }
}
